<template>
  <view class="detail-wrapper">
    <view class="paylist">
      <div class="payitemtone flex-start-line">
        <image src="/static/images/basic.png" />
        <span class="pl10">社保明细</span>
      </div>
      <div class="payitem2 flex">
        <span style="font-size:12px;font-color:#3C3D43;font-weight: 700; ">缴纳项目</span>
        <span style="font-size:12px;font-color:#3C3D43;font-weight: 700; ">个人缴费</span>
      </div>
      <div v-for="(item, index) in socItemInfo" :key="index" class="payitem flex">
        <span>{{ item.name }}</span>
        <span>{{item.value}}</span>
      </div>
    </view>
    <view class="paylist" v-if="pfItemInfo.length !== 0">
      <view>
        <image
          src="/static/images/ok.png"
          style="position: absolute;top: 10px;right: 10px;width:97px;height: 67px;"
        />
      </view>
      <div class="payitemtone flex-start-line">
        <image src="/static/images/lv.png" />
        <span class="pl10">公积金明细</span>
      </div>
      <div  class="payitem2 flex">
        <span style="font-size:12px;font-color:#3C3D43;font-weight: 700; ">缴纳项目</span>
        <span style="font-size:12px;font-color:#3C3D43;font-weight: 700;">个人缴费</span>
      </div>
      <div v-for="(item2, index) in pfItemInfo" :key="index" class="payitem flex">
        <span>{{ item2.name }}</span>
        <span>{{item2.value}}</span>
      </div>
    </view>
    <div class="bottomst">
      <u-icon name="info-circle-fill" :color="settings.theme" size="28" class="mr6"></u-icon>
      <span style="font-size:12px;">此数据仅供参考，请以实际缴费数据为准。</span>
    </div>
  </view>
</template>
<script>
import { mapState } from 'vuex'
export default {
  data() {
    return {
      socItemInfo: [],
      pfItemInfo: [],

    };
  },
  computed: {
    ...mapState(['settings'])
  },
  onLoad: function(option) {
    const info = JSON.parse(decodeURIComponent(option.item));
      for (var key in info.socItemInfo){
      this.socItemInfo.push({name:key,value:info.socItemInfo[key]});
    }
    for (var key in info.pfItemInfo){
      this.pfItemInfo.push({name:key,value:info.pfItemInfo[key]});
    }
    uni.setNavigationBarTitle({
      title:info.year+"年"+info.month+"月"
    })
  },
  created() {
  },
  methods: {}
};
</script>
<style lang="scss">
page {
  background-color: $bg-gray;
}
.bottomst{
  margin-top:20px;
  margin-bottom:50px;
  width:100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}
.background-top {
  margin-top: -20px;
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 110px;
  margin-left: -21px;
  .image {
       width: 100%;
       height: 180px;
     }
}
.detail-wrapper {
  width: 100%;
  height: 100%;
  background-color: $bg-gray;

  .pay-info {
    width: 100%;
    height: 122px;
    border-radius: 12px;
    margin: 12px auto;
    position: relative;

    image {
      width: 100%;
      height: 105px;
      border-radius: 12px;
    }

    p {
      position: absolute;
      left: 30px;
      color: #222426;
    }

    p:nth-of-type(1) {
      top: 20px;
      font-size: 30px;
      font-weight: 500;
      color: rgba(34, 36, 38, 1);
      line-height: 42px;
    }

    p:nth-of-type(2) {
      top: 62px;
      font-size: 12px;
      font-weight: 400;
      color: rgba(34, 36, 38, 1);
      line-height: 20px;
    }
  }
  .pay-info2 {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    margin: 12px auto;
    position: relative;

    image {
      width: 100%;
      height: 105px;
      border-radius: 12px;
    }

    p {
      position: absolute;
      left: 30px;
      color: #222426;
    }

    p:nth-of-type(1) {
      top: -20px;
      font-size: 30px;
      font-weight: 500;
      color: #ffffff;
      line-height: 42px;
    }

    p:nth-of-type(2) {
      top: 22px;
      font-size: 12px;
      font-weight: 400;
      color: #ffffff;
      line-height: 20px;
    }
  }
  .paylist {
    width: 100%;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0px 0px 7px 0px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin-top: 12px;
    position: relative;
    .payitemtone{
      height: 54px;
      margin: 0 20px;
      justify-content: space-between;
      padding: 0 0px;
      span {
        display: block;
        font-size: 14px;
        font-weight: 700;
        color: #3C3D43;
        line-height: 21px;
      }
      image {
        width: 20px;
        height: 20px;
      }
    }
    .payitemt {
      height: 54px;
      margin: 0 20px;
      justify-content: space-between;
      border-bottom: 1px solid #e8e8e8;
      padding: 0 0px;
      span {
        display: block;
        font-size: 15px;
        font-weight: 400;
        color: rgba(119, 119, 119, 1);
        line-height: 21px;
      }
    }
    .payitem2{
      height: 42px;
      border-radius: 10px 10px 0px 0px;
      margin: 0 20px;
      justify-content: space-between;
      padding: 0 40px;
      background-color: rgba(119, 119, 119, 0.068);
      image {
        width: 20px;
        height: 20px;
      }
      span {
        display: block;
        font-size: 15px;
        font-weight: 400;
        color: rgba(119, 119, 119, 1);
        line-height: 21px;
      }
    }
    .payitem {
      height: 48px;
      margin: 0 20px;
      justify-content: space-between;
      border-bottom: 1px solid #e8e8e8;
      padding: 0 40px;

      image {
        width: 20px;
        height: 20px;
      }

      span {
        display: block;
        font-size: 12px;
        font-weight: 400;
        color: #55565D;
        line-height: 21px;
      }

      .payitem-left {
        p:nth-of-type(1) {
          font-size: 15px;
          font-weight: 400;
          color: rgba(34, 36, 38, 1);
          line-height: 21px;
        }

        p:nth-of-type(2) {
          font-size: 12px;
          font-weight: 400;
          color: rgba(34, 36, 38, 0.7);
          line-height: 17px;
        }
      }

      .payitem-right {
        display: flex;
        align-items: center;
        font-size: 15px;
        font-weight: 400;
        color: rgba(34, 36, 38, 1);
        line-height: 21px;
      }
    }

    .payitem:nth-last-of-type(1) {
      border: none;
    }
  }

  .paylist:nth-last-of-type(1) {
    margin-bottom: 20px;
  }

  .pay-tip {
    margin: 20px auto;

    p {
      font-size: 12px;
      font-weight: 400;
      color: rgba(34, 36, 38, 1);
      line-height: 17px;

      span {
        color: $theme;
      }
    }
  }

  .btn-confirm {
    width: 90%;
    height: 50px;
    background: $theme;
    border-radius: 12px;
    margin: 20px auto 0;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 1);
    line-height: 50px;
  }
}
</style>
